package com.ssn.state.game;

public class Professional extends Level{

    Professional(Level level){
        this.name = "高手级";
        this.game = level.game;
        this.score = level.score;
    }

    @Override
    public void checkLevel(int score) {
        if (score >= 100){
            game.setLevel(new Final(this));
        }else if(score >= 40 && score < 70){
            game.setLevel(new Secondary(this));
        }else if (score < 40){
            game.setLevel(new Primary(this));
        }
    }

    @Override
    public void win() {
        if (useDouble){
            this.score += 10 * 2;
        }else{
            this.score += 10;
        }
        checkLevel(this.score);
        System.out.println("现在积分为 ： " + this.score);
        System.out.println("现在等级为 ： " + this.game.getLevel().name);
        useDouble =false;
    }

    @Override
    public void loose() {
        this.score -= 7;
        checkLevel(this.score);
        System.out.println("现在积分为 ： " + this.score);
        System.out.println("现在等级为 ： " + this.game.getLevel().name);
    }

    @Override
    public void play() {
        System.out.println("高手级play");
    }

    @Override
    public void doubleScore() {
        System.out.println("使用加倍功能！！");
        useDouble = true;
    }

    @Override
    public void changeCards() {
        System.out.println("高手级更换卡牌！");
    }

    @Override
    public void peekCards() {
        System.out.println("高手级无偷看排功能");
    }
}
